using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Salaryreport : IAccessible<T_Salaryreport, Salaryreport>, ILogicEntity<T_Salaryreport, Salaryreport>
    {
        public int ID { get; set; }

        public string Year { get; set; }

        public string Month { get; set; }

        public string UserName { get; set; }

        public decimal BasicSalary { get; set; }

        public decimal SaledMoney { get; set; }

        public decimal RoyaltyRate { get; set; }

        public decimal OnTimeRate { get; set; }

        public decimal Bonus { get; set; }

        public decimal RealSalary { get; set; }

        protected override void Covariant(T_Salaryreport model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.Year = model.Year;
                    this.Month = model.Month;
                    this.UserName = model.UserName;
                    this.BasicSalary = model.BasicSalary;
                    this.SaledMoney = model.SaledMoney;
                    this.RoyaltyRate = model.RoyaltyRate;
                    this.OnTimeRate = model.OnTimeRate;
                    this.Bonus = model.Bonus;
                    this.RealSalary = model.RealSalary;
            }
}
        protected override T_Salaryreport Inverter(Salaryreport model)
        {
            if (model != null)
            {
                return new T_Salaryreport()
                {
                    ID = model.ID,
                    Year = model.Year,
                    Month = model.Month,
                    UserName = model.UserName,
                    BasicSalary = model.BasicSalary,
                    SaledMoney = model.SaledMoney,
                    RoyaltyRate = model.RoyaltyRate,
                    OnTimeRate = model.OnTimeRate,
                    Bonus = model.Bonus,
                    RealSalary = model.RealSalary,
                };
            }
            return null;
        }
        public Salaryreport Set(T_Salaryreport dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
